package com.ruoyi.system.basicInformation.service;

import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.TViolationTypeTree;
import com.ruoyi.system.basicInformation.domain.TViolationType;
import com.ruoyi.system.basicInformation.vo.TViolationTypeVo;
import com.ruoyi.system.basicInformation.bo.TViolationTypeQueryBo;
import com.ruoyi.system.basicInformation.bo.TViolationTypeAddBo;
import com.ruoyi.system.basicInformation.bo.TViolationTypeEditBo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Collection;
import java.util.List;

/**
 * 违法类型Service接口
 *
 * @author ruoyi
 * @date 2021-06-01
 */
public interface ITViolationTypeService extends IService<TViolationType> {
	/**
	 * 查询单个
	 * @return
	 */
	TViolationTypeVo queryById(Long id);

	/**
	 * 查询列表
	 */
	List<TViolationTypeVo> queryList(TViolationTypeQueryBo bo);

	/**
	 * 根据新增业务对象插入违法类型
	 * @param bo 违法类型新增业务对象
	 * @return
	 */
	Boolean insertByAddBo(TViolationTypeAddBo bo);

	public String checkUserNameUnique(String userName, int id);

	/**
	 * 根据编辑业务对象修改违法类型
	 * @param bo 违法类型编辑业务对象
	 * @return
	 */
	Boolean updateByEditBo(TViolationTypeEditBo bo);

	/**
	 * 校验并删除数据
	 * @param ids 主键集合
	 * @param isValid 是否校验,true-删除前校验,false-不校验
	 * @return
	 */
	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

	public List<TreeSelect> buildViolationTypeTreeSelect(List<TViolationTypeTree> menus);

	public List<TViolationTypeTree> buildViolationTypeTree(List<TViolationTypeTree> depts);

	public List<TViolationTypeTree> selectViolationTypeList(TViolationTypeTree dept);
}
